//
//  SellTableViewCell.m
//  CarHome
//
//  Created by 王建男 on 14-9-18.
//  Copyright (c) 2014年 WJN_work@163.com. All rights reserved.
//

#import "SellTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation SellTableViewCell

- (void)dealloc
{
    [_car_Image release];
    [_car_Model release];
    [_car_Name release];
    [_car_Price release];
    _car_Image = nil;
    _car_Model = nil;
    _car_Name = nil;
    _car_Price = nil;
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self creatCellView];
    }
    return self;
}

#pragma mark -
#pragma mark creatCellView

- (void)creatCellView
{
    
    _car_Image = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 80, 60)];
    [self addSubview:_car_Image];
    
    _car_Name = [[UILabel alloc] initWithFrame:CGRectMake(_car_Image.frame.size.width + 20, 10, self.frame.size.width - _car_Image.frame.size.width - 30, 40)];
    [self addSubview:_car_Name];
    
    _car_Model = [[UILabel alloc] initWithFrame:CGRectMake(_car_Name.frame.origin.x, _car_Name.frame.origin.y + 40, 80, 20)];
     [_car_Model setFont:[UIFont systemFontOfSize:14]];
    [self addSubview:_car_Model];
    
    _car_Price = [[UILabel alloc] initWithFrame:CGRectMake(_car_Model.frame.origin.x + _car_Model.frame.size.width + 10, _car_Model.frame.origin.y, 100, 20)];
    [_car_Price setFont:[UIFont systemFontOfSize:14]];
    [_car_Price setTextColor:[UIColor orangeColor]];
    [self addSubview:_car_Price];
}

#pragma mark -
#pragma mark setCell

- (void)setCell:(NSString *)img Andname:(NSString *)name Andmodel:(NSString *)model Andprice:(NSString *)price
{
    [_car_Image sd_setImageWithURL:[NSURL URLWithString:img] placeholderImage:[UIImage imageNamed:@"Loading.png"]];
    
    [_car_Name setFont:[UIFont fontWithName:@"Arial" size:16]];
    [_car_Name setNumberOfLines:2];
    [_car_Name setText:name];
    
    [_car_Model setText:model];
    [_car_Price setText:price];
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
